import { prepareExecute } from '.'

/**
 * 数据库 tag 表
 */
// export class TagModel {
//   id?: number
//   name?: string
// }

export const addTag = async function(tagInfo) {
  const sql = `insert into tag values(null, ?)`
  const values = [tagInfo['name']]
  return await prepareExecute(sql, values)
}

export const queryAllTags = async function() {
  const sql = `select * from tag`
  const values = []
  return await prepareExecute(sql, values)
}

export const deleteTag = async function(id) {
  const sql = `delete from tag where id = ?`
  const values = [id]
  return await prepareExecute(sql, values)
}

